Ultimate tasking
WICT v6.0 brings setting up tasks on Dedi server to a new level. Required readings : #'Multiplayer framework' #'Double trigger method' #'rEXECVM and Dedi' Recommended tool : Briefing Manager by alimag Thanx to mikey's taskHint. __FORCETOC__ Introduction Assigning tasks to players is very important for keeping them (in)sane in a sandbox game. Each time I created a sandbox mission first comments were : "I don't know where to go? What I am supposed to do?". I simply didn't have time or knowledge to make something easy to use and Dedi friendly. Now WICT v6.0 brings you useful scripts that you can call and do whatever you want with tasks!!! So let us begin. Sandbox_exe.sqf You will frequently see this file mentioned. Example: base","mixedBase_1","yes","Primary: capture enemy base!","Intel: * Capture the enemy base at the airport. ** Background info:< br/ >put some text here -- use Briefing manager to easily write the text and of course Word Wrap in your text editor :) be creative :D","yes","all" call RE; : where * are HTML command for break line < br/ > What does it mean? This is Multiplayer framework command, and in this example it executes script WICT\sandbox\''sandbox_exe.sqf'' which then executes WICT\sandbox\taskCreator.sqf and creates a task from specified parameters. Task parameters 1) this will be the location of the task (String - optional - default: blank "") -- you can make your own description that will appear in dynamic briefing e.g. "middle of nowhere..." 2) this will be marker of that location (String - optional - default: blank "") -- this marker will be associated with HUD marker and with coordinates in dynamic briefing 3) this will dynamic briefing about the task that was given (optional) -- "yes" if you want it, if not you can leave it blank "" (no need to write "no", but you can) 4) Enter task title 5) Enter task message 6) Assign this task uppon creation ("yes" or "no", default "no" or leave it blank "") 7) Write side, but in the for of string (with quotes) "west", "east", "civilian", "resistance" or "all" (default "all", or blank ""). Task status To manage some task you simply make a trigger that publicVariable "task_report" with task title and task status. Example: task_report = capture enemy base!","s"; publicVariable "task_report"; will make task with title Primary: capture enemy base! SUCCEEDED (s). You can also make it FAILED (f) or CANCELED ©. How to use #Create trigger #Name the trigger (if you want to connect it with some other, see below) #Activation : anybody + present + once #Timeout : 2 + 2 + 2 #Condition: (vehicle player) in thislist #on Act.: task_report = capture enemy base!","s"; publicVariable "task_report"; Making story - linking tasks You can link tasks with trigger names. #Create trigger #Name the trigger (trig1) #Activation : anybody + present + once #Timeout : 2 + 2 + 2 #Condition: (vehicle player) in thislist #on Act.: task_report = capture enemy base!","s"; publicVariable "task_report"; here","Just go here, that will be your new HQ, nothing fancy...","yes","all" call RE; this will give another task after the first one is completed. Next trigger that links to the first one should look like this : #Create trigger #Name the trigger (trig2) #Activation : anybody + present + once #Timeout : 2 + 2 + 2 #Condition: triggeractivated trig1 and (vehicle player) in thislist #on Act.: task_report = here","s"; publicVariable "task_report"; Removing tasks Open WICT\sandbox\taskMonitor.sqf At the end of the file, after task update add some lines, it should like this (YOU add bold lines): if (_tsk_status "s") then {call compile format setTaskState ""SUCCEEDED""; [tskObj%1 execVM ""WICT\sandbox\fTaskHint.sqf"";",_tskNum];}; if (_tsk_status "f") then {call compile format setTaskState ""FAILED""; [tskObj%1 execVM ""WICT\sandbox\fTaskHint.sqf"";",_tskNum];}; if (_tsk_status "c") then {call compile format setTaskState ""CANCELED""; [tskObj%1 execVM ""WICT\sandbox\fTaskHint.sqf"";",_tskNum];}; sleep 20; _null = call compile format removeSimpleTask tskObj%1;",_tskNum; Checking task status You can always check a status of the task, because they are recorder in the list : { if (((_x select 0) "The longest vacation") and ((_x select 1) "s'")) then { //something happens if that task is e.g. successful }; if (((_x select 0) "'The longest vacation") and ((_x select 1) "f")) then { //something happens if that task is e.g. failed }; } forEach WICT_tasks_list; Category:Snippets